import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Boton para cambiar de imagen en la ayuda.
 * 
 * @Asael Hernández García 
 * @version (a version number or a date)
 */
public class Next extends Boton
{
    /**
     * Act - do whatever the Next wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private int cont;
    private SimpleTimer timer;
    
    public Next()
    {
        timer = new SimpleTimer();
        timer.mark();
    }
    
    
    public void act() 
    {
        if(Greenfoot.mousePressed(this)){
            getWorld().setBackground("Objetivo.png");
            if(!getWorld().getObjects(Return.class).isEmpty())
                 getWorld().removeObjects(getWorld().getObjects(Return.class));
            setImage("empty.png");
            Greenfoot.delay(1000);
            getWorld().setBackground("personajes.png");
            Greenfoot.delay(1000);
            getWorld().setBackground("Menu.png");
            getWorld().addObject(new Help(),118,522);
            getWorld().addObject(new Play(),41,522);
            getWorld().addObject(new Credits(),193,522);
            getWorld().addObject(new Records(),795,33);
            getWorld().removeObject(this);
        }
    }
}
